import java.util.Scanner;

public class tickets {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextInt();
        int month = sc.nextInt();
        int type = sc.nextInt();
        double result = price(a,month,type);
        System.out.println(result);
    }

    public static double price(double original, int month, int type){
        if(month>=5 && month<=10){
            if(type==0) return original*0.9;
            else return original*0.85;
        }
        else {
            if(type==0) return original*0.7;
            else return original*0.65;
        }

    }
}
